<template>
  <div class="configuration-page">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="企业信息配置" name="companyInfo">
        <company-conf v-if="isShowCompanyInfo" />
      </el-tab-pane>
      <el-tab-pane label="功能模块配置" name="moduleInfo">
        <module-conf v-if="!isShowCompanyInfo" />
      </el-tab-pane>
    </el-tabs>
    <el-button type="primary" class="primary-btn-style goback-btn"><a href="">返回大屏</a></el-button>
  </div>
</template>

<script>
import CompanyConf from './components/CompanyConf'
import ModuleConf from './components/ModuleConf'

export default {
  name: 'ConfigurationAdmin',
  components: {
    CompanyConf,
    ModuleConf
  },
  data() {
    return {
      activeName: 'companyInfo',
      isShowCompanyInfo: true
    }
  },
  methods: {
    handleClick(tab, event) {
      this.activeName = tab.paneName
      this.isShowCompanyInfo = this.activeName === 'companyInfo'
    },
    back() {
      this.$router.push('/')
    }
  }
}
</script>

<style lang="scss">
.configuration-page{
  height: 100%;
  position: relative;

  .el-tabs{
    height: 100%;

    [role="tabpanel"]{
        height: 100%;
    }
  }

  .primary-btn-style{

    color: #f1f1f1;
    background-color: rgba(63, 81, 181, 0.3);
    border-color: #5967a4;

    &:hover{
      background: #0095e3;
      border-color: #0095e3;
      color: #FFFFFF;
    }
  }
  .goback-btn{
    position: absolute;
    top: 0;
    right: 0;
  }
}
</style>
